home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
System Booster
/
System Booster.iso
/
Archives
/
Timing
/
DateBKIV.lha
/
DateBookIV
/
Rexx
/
TestDBCommands.rexx
< prev
next >
Wrap
OS/2 REXX Batch file
|
1996-03-31
|
7KB
|
442 lines
/* File : dbrx.rexx
*
* $Project: DateBook
*
* $Description: Test all the rexx features in DateBook.
*
* $Module Id:
* $Original Author: Robert Hardy
* $Date Started: Sun Feb 26 1995
*
* $Revision: 1.4 $
*
* $State: Exp $
*
* $Locker: $
*
* $Log: dbrx.rexx-v $
# Revision 1.4 1996/02/06 07:46:46 Bob
# Cleaned up report tests.
#
# Revision 1.3 1995/12/17 08:55:39 Bob
# fixed typo.
#
# Revision 1.2 1995/11/20 00:49:54 Bob
# Added support for new Notes and Priority fields.
# fixed setting time field test.
#
# Revision 1.1 1995/03/22 20:30:21 Bob
# Initial revision
#
*
*
*/
options results
TICK = '27'X
port_name = 'datebook_rx'
port_off = 0
if ~show('p', port_name) then do /* Find Out if DynaEngine is running */
port_off = 1 /* Set the flag so we can clean up on exit */
/* Run Datebook */
address command 'run DateBook mode=SERVER RXPORT='port_name' FILE=dates.dat'
address command 'waitforport 'port_name /* Wait till it's loaded */
end
address VALUE port_name
say ''
say '** getting first **'
'GOTORECORD FIRST'
if (rc = 0) then
say 'result = "'result'"'
else
say 'rc = 'rc
say ''
say '** Getting first record **'
'GETFIELD $d $t $p $e $y $w $f $x $r $n'
if (rc = 0) then
say 'result = "'result'"'
else
say 'rc = 'rc
say ''
say '** Getting next record **'
'NEXTRECORD'
if (rc = 0) then
say 'result = "'result'"'
else
say 'rc = 'rc
'GETFIELD $d $t $p $e $y $w $f $x $r $n'
if (rc = 0) then
say 'result = "'result'"'
else
say 'rc = 'rc
say ''
say '** Getting previous record **'
'PREVRECORD'
if (rc = 0) then
say 'result = "'result'"'
else
say 'rc = 'rc
'GETFIELD $d $t $p $e $y $w $f $x $r $n'
if (rc = 0) then
say 'result = "'result'"'
else
say 'rc = 'rc
say ''
say '** Getting last record **'
'GOTORECORD LAST'
if (rc = 0) then
say 'result = "'result'"'
else
say 'rc = 'rc
'GETFIELD $d $t $p $e $y $w $f $x $r $n'
if (rc = 0) then
say 'result = "'result'"'
else
say 'rc = 'rc
say ''
say '** Getting record 3 **'
'GOTORECORD 3'
if (rc = 0) then
say 'result = "'result'"'
else
say 'rc = 'rc
'GETFIELD $d $t $p $e $y $w $f $x $r $n'
if (rc = 0) then
say 'result = "'result'"'
else
say 'rc = 'rc
say ''
say '** Searching for "christ" **'
'FINDRECORD $E christ'
if (rc = 0) then
do
say 'result = "'result'"'
'GETFIELD $d $t $p $e $y $w $f $x $r $n'
if (rc = 0) then
say 'result = "'result'"'
else
say 'rc = 'rc
say ''
say '** Looking for next match **'
'nextmatch'
if (rc = 0) then
do
say 'result = "'result'"'
'GETFIELD $d $t $p $e $y $w $f $x $r $n'
if (rc = 0) then
say 'result = "'result'"'
else
say 'rc = 'rc
nop
end
else
say 'rc = 'rc
say ''
say '** moving to last record **'
'GOTORECORD LAST'
if (rc = 0) then
say 'result = "'result'"'
else
say 'rc = 'rc
say ''
say '** Looking for previous match **'
'prevmatch'
if (rc = 0) then
do
say 'result = "'result'"'
'GETFIELD $d $t $p $e $y $w $f $x $r $n'
if (rc = 0) then
say 'result = "'result'"'
else
say 'rc = 'rc
end
else
say 'rc = 'rc
end
else
say 'rc = 'rc
say ''
say '** Printing month summary **'
'summary 11 1996'
if (rc = 0) then
say result
else do
if rc = 5 then
say 'Nothing to Report'
else
say 'rc = 'rc
end
say ''
say '** Printing todays events **'
'today'
if (rc = 0) then
say 'result = "'result'"'
else do
if rc = 5 then
say 'Nothing to Report'
else
say 'rc = 'rc
end
say ''
say '** getting events for a date **'
'EVENTS 19960228'
if (rc = 0) then
say 'result = "'result'"'
else do
if rc = 5 then
say 'Nothing to Report'
else
say 'rc = 'rc
end
say ''
say '** Getting upcoming events **'
'UPCOMMING'
if (rc = 0) then
say 'result = "'result'"'
else do
if rc = 5 then
say 'Nothing to Report'
else
say 'rc = 'rc
end
say ''
say '** Adding a record **'
'ADDRECORD'
if (rc = 0) then
say 'result = "'result'"'
else
say 'rc = 'rc
say ''
say '** Setting record contents **'
'SETFIELD $d 19960102 $t 0100 $e Test Event xxx $y k $w 5 $f 2 $x 'TICK'say 'TICK'hello'TICK
if (rc = 0) then
say 'result = "'result'"'
else
say 'rc = 'rc
'GETFIELD $d $t $p $e $y $w $f $x $r $n'
if (rc = 0) then
say 'result = "'result'"'
else
say 'rc = 'rc
say ''
say '** Sorting Database **'
'sortdb'
if (rc = 0) then
say 'result = "'result'"'
else
say 'rc = 'rc
say ''
say '** Looking for record we added **'
'FINDRECORD $E xxx'
if (rc = 0) then
do
recnum = result
say 'recnum = 'recnum
'GETFIELD $d $t $p $e $y $w $f $x $r $n'
if (rc = 0) then
say 'result = "'result'"'
else
say 'rc = 'rc
say ''
say '** deleting record **'
'DELETERECORD'
if (rc = 0) then
say 'result = "'result'"'
else
say 'rc = 'rc
end
else
say 'rc = 'rc
say ''
say '** Saving Database **'
'savedb datestest.dat'
if (rc = 0) then
say 'result = "'result'"'
else
say 'rc = 'rc
say ''
say '** Test String2date tomorrow **'
'STRING2DATE tomorrow'
if (rc = 0) then
say 'result = "'result'"'
else
say 'rc = 'rc
say ''
say '** Test String2date today **'
'STRING2DATE today'
if (rc = 0) then
say 'result = "'result'"'
else
say 'rc = 'rc
say ''
say '** Test String2date saturday **'
'STRING2DATE saturday'
if (rc = 0) then
say 'result = "'result'"'
else
say 'rc = 'rc
say ''
say '** Test GetMonthName 1 **'
'GETMONTHNAME 1'
if (rc = 0) then
say 'result = "'result'"'
else
say 'rc = 'rc
say ''
say '** Test GetMonthName 11 **'
'GETMONTHNAME 11'
if (rc = 0) then
say 'result = "'result'"'
else
say 'rc = 'rc
say ''
say '** Test DayName 19950322 **'
'DAYNAME 19950322'
if (rc = 0) then
say 'result = "'result'"'
else
say 'rc = 'rc
say ''
say '** Test Expand_Date 19950309 **'
'EXPANDDATE 19950309'
if (rc = 0) then
say 'result = "'result'"'
else
say 'rc = 'rc
say ''
say '** Test ISVALID 19951332 **'
'ISVALID 19951332'
if (rc = 0) then
say 'result = "'result'"'
else
say 'rc = 'rc
say ''
say '** Test ISVALID 19950302 **'
'ISVALID 19950302'
if (rc = 0) then
say 'result = "'result'"'
else
say 'rc = 'rc
say ''
say '** Changing to Iconified mode - AppIcon **'
SETICONIFY 'ICON'
if (rc = 0) then
say 'old iconify type = "'result'"'
else
say 'rc = 'rc
CHANGEMODE 'ICONIFY'
if (rc = 0) then
say 'old mode = "'result'"'
else
say 'rc = 'rc
delay(50 * 5)
say ''
say '** Changing to Editor mode **'
CHANGEMODE 'EDIT'
if (rc = 0) then
say 'old mode = "'result'"'
else
say 'rc = 'rc
delay(50 * 5)
say ''
say '** Changing to Iconified mode - Clock **'
SETICONIFY 'CLOCK'
if (rc = 0) then
say 'old iconify type = "'result'"'
else
say 'rc = 'rc
CHANGEMODE 'ICONIFY'
if (rc = 0) then
say 'old mode = "'result'"'
else
say 'rc = 'rc
delay(50 * 5)
say ''
say '** Changing to Memo mode **'
CHANGEMODE 'MEMO'
if (rc = 0) then
say 'old mode = "'result'"'
else
say 'rc = 'rc
delay(50 * 5)
say ''
say '** Changing to Iconified mode - Calendar **'
SETICONIFY 'CAL'
if (rc = 0) then
say 'old iconify type = "'result'"'
else
say 'rc = 'rc
CHANGEMODE 'ICONIFY'
if (rc = 0) then
say 'old mode = "'result'"'
else
say 'rc = 'rc
say ''
say "All done!"
if port_off > 0 then 'SHUTDOWN'
exit 0